package com.newtouch.bxzs.business.train.controller;

import com.newtouch.bxzs.business.config.MyLog;
import com.newtouch.bxzs.business.train.model.vo.UserCourseLearningRecordVO;
import com.newtouch.bxzs.business.train.service.UserCourseLearningRecordService;
import com.newtouch.bxzs.business.train.service.impl.UserCourseLearningRecordServiceImpl;
import com.newtouch.bxzs.common.base.response.BaseResponse;
import com.newtouch.bxzs.common.base.response.RespGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户课程学习记录管理controller类
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/2/23 17:19</td>
 * <td>dingqianbin</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author dingqianbin
 * @version 1.0.0
 * @since 1.0.0
 */
@Api(tags = "用户课程学习记录管理")
@RestController
@RequestMapping(value = "/userCourseLearningRecordController")
@SuppressWarnings("unchecked")
public class UserCourseLearningRecordController {

    private static final Log logger = LogFactory.getLog(UserCourseLearningRecordServiceImpl.class);

    @Autowired
    UserCourseLearningRecordService userCourseLearningRecordService;

    @ApiOperation(value = "新增用户课程学习记录")
    @PostMapping("/addUserCourseLearningRecord")
    @MyLog(systemFunctionName = "用户课程管理", systemFunctionUrl = "/userCourseLearningRecordController/addUserCourseLearningRecord", userOperationType = 1, userOperationSummary = "新增用户课程学习记录")
    public BaseResponse<Integer> addUserCourseLearningRecord(@RequestBody UserCourseLearningRecordVO userCourseLearningRecordVO) {
        logger.info("新增用户课程学习记录");
        return RespGenerator.returnOK(userCourseLearningRecordService.addUserCourseLearningRecord(userCourseLearningRecordVO));
    }
}
